/*
 * Copyright 2020 edenrun.cn All right reserved. This software is the
 * confidential and proprietary information ofedenrun.cn ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with edenrun.cn.
 */

package com.zoom.pluto.zxg.controller;

import com.zoom.pluto.common.model.dto.ZxgDTO;
import com.zoom.pluto.zxg.model.dto.Result;
import com.zoom.pluto.zxg.service.impl.ZxgServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 心血管仪器查询控制层
 *
 * @author zoom
 * @date 2020-06-14
 */

@CrossOrigin(origins = "*", allowedHeaders = "*", maxAge = 3600)
@RestController
@Api(value = "Zxg服务接口", tags = {"Zxg服务接口"})
public class ZxgClientController {

    @Resource
    ZxgServiceImpl zxgService;

    @ApiOperation(value = "根据身份证号取得病人所有心血管信息", httpMethod = "GET")
    @GetMapping(value = "/zxg/query/idno/{idno}")
    public Result<ZxgDTO> querySmfDetailByPatNo(@PathVariable String idno) {

        return Result.success(zxgService.getLatestZxgInfo(idno));
    }

}
